import React from 'react';
import Son from './Son'
import Mycontext from '../Mycontext';


export default class Father extends React.Component {
    constructor(props){
        super(props)
    }
    static contextType=Mycontext;

    render(){
        return (
            <Mycontext>
                {
                    (value)=>{
                        return(
                            <div className="Father">
                            <ul>
                                {
                                    value.goods.lists.map(list=>{
                                        return(
                                            <li key={list.id}>{list.name}</li>
                                        )
                                    })
                                }
                            </ul>
                            <Son />
                        </div>
                           
                        )
                    }
                }
            </Mycontext>
           
          );
    }
  
}